/*****************************************************************************
*        描述 :
*             文件描述
*        CLR版本:            3.5
*        创建者 :            蒋 光
*        个人域名:           jiangguang.net.cn
*        命名空间名称:       ECP.Model
*        文件名:             BaseContactDetailsEntity.cs
*        创建系统时间:       2012/11/2 19:07:02
*        创建年份:           2012
*
/*****************************************************************************/

namespace ECP.Model
{
    using System;
    using System.Data;
    using ECP.Utilities;

    [Serializable]
    public class BaseContactDetailsEntity
    {
        private string category;
        private string contactID;
        private string createDate;
        private string createUserID;
        private string createUserRealName;
        private bool deleteMark;
        private string description;
        private bool enabled;
        private string id;
        private bool isNew;
        private string lastViewDate;
        private string lastViewIP;
        private string modifyDate;
        private string modifyUserID;
        private bool newComment;
        private string receiverID;
        private string receiverRealName;
        private string sortCode;

        public BaseContactDetailsEntity()
        {
        }

        public BaseContactDetailsEntity(DataRow dataRow)
        {
            this.GetFrom(dataRow);
        }

        public BaseContactDetailsEntity(DataTable dataTable)
        {
            this.GetFrom(dataTable);
        }

        public BaseContactDetailsEntity GetFrom(DataRow dataRow)
        {
            this.ID = BaseBusinessLogic.ConvertToString(dataRow[BaseContactDetailsTable.FieldID]);
            this.ContactID = BaseBusinessLogic.ConvertToString(dataRow[BaseContactDetailsTable.FieldContactID]);
            this.Category = BaseBusinessLogic.ConvertToString(dataRow[BaseContactDetailsTable.FieldCategory]);
            this.ReceiverID = BaseBusinessLogic.ConvertToString(dataRow[BaseContactDetailsTable.FieldReceiverID]);
            this.ReceiverRealName = BaseBusinessLogic.ConvertToString(dataRow[BaseContactDetailsTable.FieldReceiverRealName]);
            this.IsNew = BaseBusinessLogic.ConvertIntToBoolean(dataRow[BaseContactDetailsTable.FieldIsNew]);
            this.NewComment = BaseBusinessLogic.ConvertIntToBoolean(dataRow[BaseContactDetailsTable.FieldNewComment]);
            this.LastViewIP = BaseBusinessLogic.ConvertToString(dataRow[BaseContactDetailsTable.FieldLastViewIP]);
            this.LastViewDate = BaseBusinessLogic.ConvertToString(dataRow[BaseContactDetailsTable.FieldLastViewDate]);
            this.Enabled = BaseBusinessLogic.ConvertIntToBoolean(dataRow[BaseContactDetailsTable.FieldEnabled]);
            this.DeleteMark = BaseBusinessLogic.ConvertIntToBoolean(dataRow[BaseContactDetailsTable.FieldDeleteMark]);
            this.SortCode = BaseBusinessLogic.ConvertToString(dataRow[BaseContactDetailsTable.FieldSortCode]);
            this.Description = BaseBusinessLogic.ConvertToString(dataRow[BaseContactDetailsTable.FieldDescription]);
            this.CreateDate = BaseBusinessLogic.ConvertToString(dataRow[BaseContactDetailsTable.FieldCreateDate]);
            this.CreateUserID = BaseBusinessLogic.ConvertToString(dataRow[BaseContactDetailsTable.FieldCreateUserID]);
            this.CreateUserRealName = BaseBusinessLogic.ConvertToString(dataRow[BaseContactDetailsTable.FieldCreateUserRealName]);
            this.ModifyDate = BaseBusinessLogic.ConvertToString(dataRow[BaseContactDetailsTable.FieldModifyDate]);
            this.ModifyUserID = BaseBusinessLogic.ConvertToString(dataRow[BaseContactDetailsTable.FieldModifyUserID]);
            return this;
        }

        public BaseContactDetailsEntity GetFrom(DataTable dataTable)
        {
            if ((dataTable == null) || (dataTable.Rows.Count == 0))
            {
                return null;
            }
            foreach (DataRow row in dataTable.Rows)
            {
                this.GetFrom(row);
                break;
            }
            return this;
        }

        public string Category
        {
            get
            {
                return this.category;
            }
            set
            {
                this.category = value;
            }
        }

        public string ContactID
        {
            get
            {
                return this.contactID;
            }
            set
            {
                this.contactID = value;
            }
        }

        public string CreateDate
        {
            get
            {
                return this.createDate;
            }
            set
            {
                this.createDate = value;
            }
        }

        public string CreateUserID
        {
            get
            {
                return this.createUserID;
            }
            set
            {
                this.createUserID = value;
            }
        }

        public string CreateUserRealName
        {
            get
            {
                return this.createUserRealName;
            }
            set
            {
                this.createUserRealName = value;
            }
        }

        public bool DeleteMark
        {
            get
            {
                return this.deleteMark;
            }
            set
            {
                this.deleteMark = value;
            }
        }

        public string Description
        {
            get
            {
                return this.description;
            }
            set
            {
                this.description = value;
            }
        }

        public bool Enabled
        {
            get
            {
                return this.enabled;
            }
            set
            {
                this.enabled = value;
            }
        }

        public string ID
        {
            get
            {
                return this.id;
            }
            set
            {
                this.id = value;
            }
        }

        public bool IsNew
        {
            get
            {
                return this.isNew;
            }
            set
            {
                this.isNew = value;
            }
        }

        public string LastViewDate
        {
            get
            {
                return this.lastViewDate;
            }
            set
            {
                this.lastViewDate = value;
            }
        }

        public string LastViewIP
        {
            get
            {
                return this.lastViewIP;
            }
            set
            {
                this.lastViewIP = value;
            }
        }

        public string ModifyDate
        {
            get
            {
                return this.modifyDate;
            }
            set
            {
                this.modifyDate = value;
            }
        }

        public string ModifyUserID
        {
            get
            {
                return this.modifyUserID;
            }
            set
            {
                this.modifyUserID = value;
            }
        }

        public bool NewComment
        {
            get
            {
                return this.newComment;
            }
            set
            {
                this.newComment = value;
            }
        }

        public string ReceiverID
        {
            get
            {
                return this.receiverID;
            }
            set
            {
                this.receiverID = value;
            }
        }

        public string ReceiverRealName
        {
            get
            {
                return this.receiverRealName;
            }
            set
            {
                this.receiverRealName = value;
            }
        }

        public string SortCode
        {
            get
            {
                return this.sortCode;
            }
            set
            {
                this.sortCode = value;
            }
        }
    }
}